<?php
/*
 * @Descripttion: 
 * @Author: dedeye
 * @Date: 2020-03-01 13:24:01
 * @LastEditors: dedeye
 * @LastEditTime: 2020-03-01 13:29:27
 */

use think\migration\Seeder;

class AdminSeeder extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $salt = rand(100000, 999999);
        $password = md5('123456'.$salt);
        $time = time();
        $data = [
            'username' => 'admin',
            'nickname' => 'admin',
            'password' => $password,
            'salt' => $salt,
            'create_time' => $time,
            'update_time' => $time
        ];
        $this->table('admin')->insert($data)->save();
    }
}